/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package DAO;

import DTO.QuyDinhDTO;
import java.sql.Connection;
import java.sql.PreparedStatement;

/**
 *
 * @author Nobita Chau
 */
public class TinhTrangGheDAO {
    
     public static boolean UpdateGhe(String a)
    {
        try
        {
            Connection con = DBConnect.Connect();
            String sql = "Update GHE set TINH_TRANG=2 where SO_HIEU=? ";
            
            PreparedStatement ps = con.prepareStatement(sql);
            ps.setString(1, a);
            int n = ps.executeUpdate();
            con.close();
            if (n == 1)
                return true;
        }
        catch (Exception ex)
        {
        }
        return false;
    }
     
      public static boolean UpdateGiuong(String a)
    {
        try
        {
            Connection con = DBConnect.Connect();
            String sql = "Update GIUONG set TINH_TRANG=2 where SO_HIEU=? ";
            
            PreparedStatement ps = con.prepareStatement(sql);
            ps.setString(1, a);
            int n = ps.executeUpdate();
            con.close();
            if (n == 1)
                return true;
        }
        catch (Exception ex)
        {
        }
        return false;
    }
}
